package io.geekidea.boot.vipmanagement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.geekidea.boot.vipmanagement.dto.VipmanagementDto;
import io.geekidea.boot.vipmanagement.entity.Vipmanagement;
import io.geekidea.boot.vipmanagement.query.VipmanagementQuery;
import io.geekidea.boot.viptype.entity.Viptype;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


@Mapper
public interface VipmanagementMapper extends BaseMapper<Vipmanagement> {

    Page<Vipmanagement> getVipmanagementPageList(Page<Vipmanagement> page, @Param("param") VipmanagementQuery vipmanagementQuery);

    int delById(int id);

    @Update("update tb_vipmanagement set viptypeId = #{viptypeId},typeNum=#{typeNum},money=#{money},validityTime=#{validityTime},areaId=#{areaId} where id = #{id} ")
    int updateId(VipmanagementDto vipmanagementDto);

    @Select("select id,vipType from tb_viptype")
    List<Viptype> getAll();
}
